package com.gitee.sidihuo.utils.base;

public enum SortTypeEnum {

    ASC_OUT("ascOut", "组外正序"),
    DESC_OUT("descOut", "组外倒序"),
    ASC("asc", "正序"),
    DESC("desc", "倒序");

    private final String code;

    private final String message;

    private SortTypeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }
    public String getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }

    @Override
    public String toString() {
        return String.format("Code:[%s], Describe:[%s]", this.code,
                this.message);
    }
    public static SortTypeEnum getOperatorType(String code) {
        for (SortTypeEnum operatorType : SortTypeEnum.values()) {
            if (operatorType.getCode().equals(code)) {
                return operatorType;
            }
        }
        return null;
    }

}
